import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import mixin from '@/utils/mixin'
// 自动注册全局组件
import GetGlobalComponent from './globalCom'
const app = createApp(App).use(store).use(router)
app.mixin(mixin)
// 全局组件
const comList = []
GetGlobalComponent().map((v) => {
  comList.push({
    key: v.key,
    name: v.name,
    desc: v.desc,
  })
  app.component(v.key, v)
})
store.commit('SetComList', comList)
app.use(ElementPlus)
app.mount('#app')
// app.config.globalProperties.hi = 'hi'
app.config.errorHandler = (err, vm, info) => {
  console.error('errorHandler')
  console.error(err, vm, info)
}
